home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr40 / aprs67.zip / SUMMARIZ.BAS < prev   
BASIC Source File  |  1995-01-17  |  6KB  |  142 lines

  1.  CLS
  2.  PRINT "This program will search through all backup and/or all history files"
  3.  PRINT "to extract the latest position of each station.  It outputs these summaries"
  4.  PRINT "to the ALLBAKS.hst and ALLHSTS.hst files."
  5.  PRINT
  6.  PRINT "These files are saved as HISTORY files.  This is so that they"
  7.  PRINT "can be REPLAYED at any time to find out where someone is without"
  8.  PRINT "destroying data on the P or L list."
  9.  PRINT
  10.  PRINT "Just select FILE-REPLAY and after selecting the ALLBAKS.hst or the"
  11.  PRINT "ALLHSTS.hst file, then select the callsign of the station you are looking"
  12.  PRINT "for.  If that station is in the file, APRS will draw the map with that"
  13.  PRINT "station on it."
  14.  PRINT
  15.  PRINT "Or you can use the file to see everyone in a given area.  Just choose"
  16.  PRINT "the map area you are interested in, and replay the file.  Every call in "
  17.  PRINT "the file that is in that area will appear on the map!"
  18.  PRINT
  19.  LOCATE 25, 1: INPUT "Hit ENTER to continue..."; a$
  20.  CLS
  21.  PRINT "Once you run this program ONCE, then save the two summary files in a new"
  22.  PRINT "Directory where you will accumulate new data just for the purpose of building"
  23.  PRINT "this overall SUMMARY file."
  24.  PRINT
  25.  PRINT "From then on, whenever you want to clean up your normal APRS\HSTS directory,"
  26.  PRINT "instead of just deleting all the old TKxxxxx.HST files, simply copy them"
  27.  PRINT "instead into this SUMMARY directory.  Then, run this program on this SUMMARY"
  28.  PRINT "directory.  It will combine the existing summary files and all the new"
  29.  PRINT "TKxxxxx.HST files into another single summary file!  Once you are sure it"
  30.  PRINT "is a good copy, you can delete all of the old TKxxxxx.HST files if you no"
  31.  PRINT "longer need them."
  32.  PRINT
  33.  DIM P$(700)
  34.  
  35.  INPUT "Search all BK or HST files (H)"; a$
  36.  IF LEFT$(UCASE$(a$), 1) = "B" THEN GOTO BAKS
  37.  
  38. HSTS: HSTpath$ = "\APRS\HSTS"
  39.       PRINT "Enter path to your APRS\HSTS directory if not "; HSTpath$;
  40.       INPUT a$: IF a$ <> "" THEN HSTpath$ = a$
  41.       SHELL "dir " + HSTpath$ + " >temp.hst"
  42.  
  43.      OPEN "temp.hst" FOR INPUT AS #1
  44.      DO UNTIL EOF(1)
  45.         LINE INPUT #1, a$: REM PRINT a$
  46.         IF LEN(a$) > 38 AND LEFT$(a$, 1) <> "." AND LEFT$(a$, 1) <> " " THEN
  47.            F$ = LEFT$(a$, 8) + "." + MID$(a$, 10, 3)
  48.            PRINT "Opening "; F$
  49.            OPEN HSTpath$ + "\" + F$ FOR INPUT AS #2
  50.            DO UNTIL EOF(2)
  51.               LINE INPUT #2, a$
  52.               IF LEN(a$) > 40 THEN
  53.                  NxPosC$ = MID$(a$, 1, 9)
  54.                  NxPosT$ = MID$(a$, 19, 6)
  55.                  REM PRINT LEFT$("        Found " + a$, 79)
  56.                  Haveit = 0
  57.                  FOR i = 1 TO NumPos
  58.                      IF NxPosC$ = LEFT$(P$(i), 9) THEN
  59.                         Haveit = -1
  60.                         REM now compare times
  61.                         IF NxPosT$ > MID$(P$(i), 12, 6) THEN 'it is later so swap
  62.                            P$(i) = a$: PRINT LEFT$("      NEWER POSIT: " + P$(i), 79)
  63.                         END IF 'if it was newer
  64.                      END IF' if it is the same callsign
  65.                  NEXT i ' compare to all existing P$(i)
  66.                  IF Haveit = 0 THEN
  67.                     NumPos = NumPos + 1
  68.                     P$(NumPos) = a$
  69.                     PRINT NumPos; LEFT$("      Add pos: " + P$(NumPos), 73)
  70.                  END IF
  71.               END IF' if it was a POSITION (p,)
  72.            LOOP 'read the next line in the BK file
  73.            CLOSE #2 ' Finished all of that file
  74.         END IF 'if it was a valid file name
  75.      LOOP 'to the next BK file
  76.      CLOSE #1 ' Finished that all files in that directory
  77.  
  78.      F$ = "ALLHSTS.hst"
  79.      PRINT "Enter name of OUTPUT file if other than "; F$;
  80.      INPUT a$: IF a$ <> "" THEN F$ = a$
  81.      OPEN F$ FOR OUTPUT AS #3: PRINT "OPENING OUTPUT FILE..."; F$
  82.      FOR i = 1 TO NumPos: PRINT #3, P$(i): NEXT i
  83.      CLOSE #3
  84.      PRINT : PRINT "DONE!"
  85.      STOP
  86.     
  87. BAKS: BKpath$ = "\APRS\BAKS"
  88.       PRINT "Enter path to your APRS\BAKS directory if not "; BKpath$;
  89.       INPUT a$: IF a$ <> "" THEN BKpath$ = a$
  90.       SHELL "dir " + BKpath$ + " >temp.bk"
  91.  
  92.      OPEN "temp.bk" FOR INPUT AS #1
  93.      DO UNTIL EOF(1)
  94.         LINE INPUT #1, a$: REM print a$
  95.         IF LEN(a$) > 38 AND LEFT$(a$, 1) <> "." AND LEFT$(a$, 1) <> " " THEN
  96.            F$ = LEFT$(a$, 8) + "." + MID$(a$, 10, 3)
  97.            PRINT "Opening "; F$
  98.            OPEN BKpath$ + "\" + F$ FOR INPUT AS #2
  99.            DO UNTIL EOF(2)
  100.               LINE INPUT #2, a$
  101.               IF LEFT$(a$, 1) = "p" THEN
  102.                  NxPosC$ = MID$(a$, 3, 9)
  103.                  NxPosT$ = MID$(a$, 21, 6)
  104.                  REM PRINT LEFT$("        Found " + a$, 79)
  105.                  Haveit = 0
  106.                  FOR i = 1 TO NumPos
  107.                      IF NxPosC$ = LEFT$(P$(i), 9) THEN
  108.                         Haveit = -1
  109.                         REM now compare times
  110.                         IF NxPosT$ > MID$(P$(i), 12, 6) THEN 'it is later so swap
  111.                            P$(i) = MID$(a$, 3): PRINT LEFT$("      NEWER POSIT: " + P$(i), 79)
  112.                         END IF 'if it was newer
  113.                      END IF' if it is the same callsign
  114.                  NEXT i ' compare to all existing P$(i)
  115.                  IF Haveit = 0 THEN
  116.                     NumPos = NumPos + 1
  117.                     P$(NumPos) = MID$(a$, 3)
  118.                     PRINT NumPos; LEFT$("      Add pos: " + P$(NumPos), 73)
  119.                  END IF
  120.               END IF' if it was a POSITION (p,)
  121.            LOOP 'read the next line in the BK file
  122.            CLOSE #2 ' Finished all of that file
  123.         END IF 'if it was a valid file name
  124.      LOOP 'to the next BK file
  125.      CLOSE #1 ' Finished all files in that directory
  126.  
  127.      F$ = "ALLBAKS.hst"
  128.      PRINT "Enter output file if other than "; F$;
  129.      INPUT a$: IF a$ <> "" THEN F$ = a$
  130.      OPEN F$ FOR OUTPUT AS #3: PRINT "OPENING OUTPUT FILE..."; F$
  131.      FOR i = 1 TO NumPos: PRINT #3, P$(i): NEXT i
  132.      CLOSE #3
  133.  
  134.  
  135.      END
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.